/**
 */
package wcomm_v1.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import wcomm_v1.Datatype;
import wcomm_v1.Parameter;
import wcomm_v1.Wcomm_v1Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Parameter</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link wcomm_v1.impl.ParameterImpl#getDataype <em>Dataype</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ParameterImpl extends NamedElementImpl implements Parameter
{
  /**
   * The cached value of the '{@link #getDataype() <em>Dataype</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getDataype()
   * @generated
   * @ordered
   */
  protected Datatype dataype;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ParameterImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return Wcomm_v1Package.Literals.PARAMETER;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Datatype getDataype()
  {
    if (dataype != null && dataype.eIsProxy())
    {
      InternalEObject oldDataype = (InternalEObject)dataype;
      dataype = (Datatype)eResolveProxy(oldDataype);
      if (dataype != oldDataype)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, Wcomm_v1Package.PARAMETER__DATAYPE, oldDataype, dataype));
      }
    }
    return dataype;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public Datatype basicGetDataype()
  {
    return dataype;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setDataype(Datatype newDataype)
  {
    Datatype oldDataype = dataype;
    dataype = newDataype;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, Wcomm_v1Package.PARAMETER__DATAYPE, oldDataype, dataype));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.PARAMETER__DATAYPE:
        if (resolve) return getDataype();
        return basicGetDataype();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.PARAMETER__DATAYPE:
        setDataype((Datatype)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.PARAMETER__DATAYPE:
        setDataype((Datatype)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case Wcomm_v1Package.PARAMETER__DATAYPE:
        return dataype != null;
    }
    return super.eIsSet(featureID);
  }

} //ParameterImpl
